/*
 * SMExtensionTrimBase.java
 *
 * Created on 29 Март 2008 г., 16:21
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package trim.calc;

import trim.calc.smdata.ExtensionTrimSMData;
import trim.Trim;
import trim.common.inputdata.InputData;
import trim.common.sm.SMException;
import trim.common.sm.TrimSimplex;

/**
 *
 * @author Дмитрий
 */
abstract public class SMExtensionTrim extends Trim
{
  protected TrimSimplex extensionSimplex(InputData inputData) throws SMException
  {
    ExtensionTrimSMData smData=new ExtensionTrimSMData(inputData);
    TrimSimplex sm=new TrimSimplex(smData);
    System.out.println(this.getClass().getSimpleName()+": SM first run");
    sm.solve();
    System.out.println(this.getClass().getSimpleName()+": SMResult="+sm.getObjectiveFunctionValue());
    smData.setObjectiveFunctionMinValue(sm.roundObjectiveFunction());
    sm=new TrimSimplex(smData);
    System.out.println(this.getClass().getSimpleName()+": SM second run");
    sm.solve();
    System.out.println(this.getClass().getSimpleName()+": SMResult="+sm.getObjectiveFunctionValue());
    return sm;
  }
}
